﻿using System;
using System.Diagnostics;

namespace MessagePack.LZ4
{
	// Token: 0x02000068 RID: 104
	public static class LZ4Codec
	{
		// Token: 0x06000192 RID: 402 RVA: 0x000062DC File Offset: 0x000046DC
		public static int Encode(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			if (IntPtr.Size == 4)
			{
				return LZ4Codec.Encode32Safe(input, inputOffset, inputLength, output, outputOffset, outputLength);
			}
			return LZ4Codec.Encode64Safe(input, inputOffset, inputLength, output, outputOffset, outputLength);
		}

		// Token: 0x06000193 RID: 403 RVA: 0x00006304 File Offset: 0x00004704
		public static int Decode(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			if (IntPtr.Size == 4)
			{
				return LZ4Codec.Decode32Safe(input, inputOffset, inputLength, output, outputOffset, outputLength);
			}
			return LZ4Codec.Decode64Safe(input, inputOffset, inputLength, output, outputOffset, outputLength);
		}

		// Token: 0x06000194 RID: 404 RVA: 0x0000632C File Offset: 0x0000472C
		[Conditional("DEBUG")]
		private static void Assert(bool condition, string errorMessage)
		{
			if (!condition)
			{
				throw new ArgumentException(errorMessage);
			}
		}

		// Token: 0x06000195 RID: 405 RVA: 0x0000633B File Offset: 0x0000473B
		internal static void Poke2(byte[] buffer, int offset, ushort value)
		{
			buffer[offset] = (byte)value;
			buffer[offset + 1] = (byte)(value >> 8);
		}

		// Token: 0x06000196 RID: 406 RVA: 0x0000634B File Offset: 0x0000474B
		internal static ushort Peek2(byte[] buffer, int offset)
		{
			return (ushort)((int)buffer[offset] | (int)buffer[offset + 1] << 8);
		}

		// Token: 0x06000197 RID: 407 RVA: 0x00006359 File Offset: 0x00004759
		internal static uint Peek4(byte[] buffer, int offset)
		{
			return (uint)((int)buffer[offset] | (int)buffer[offset + 1] << 8 | (int)buffer[offset + 2] << 16 | (int)buffer[offset + 3] << 24);
		}

		// Token: 0x06000198 RID: 408 RVA: 0x00006378 File Offset: 0x00004778
		private static uint Xor4(byte[] buffer, int offset1, int offset2)
		{
			uint num = (uint)((int)buffer[offset1] | (int)buffer[offset1 + 1] << 8 | (int)buffer[offset1 + 2] << 16 | (int)buffer[offset1 + 3] << 24);
			uint num2 = (uint)((int)buffer[offset2] | (int)buffer[offset2 + 1] << 8 | (int)buffer[offset2 + 2] << 16 | (int)buffer[offset2 + 3] << 24);
			return num ^ num2;
		}

		// Token: 0x06000199 RID: 409 RVA: 0x000063C4 File Offset: 0x000047C4
		private static ulong Xor8(byte[] buffer, int offset1, int offset2)
		{
			ulong num = (ulong)buffer[offset1] | (ulong)buffer[offset1 + 1] << 8 | (ulong)buffer[offset1 + 2] << 16 | (ulong)buffer[offset1 + 3] << 24 | (ulong)buffer[offset1 + 4] << 32 | (ulong)buffer[offset1 + 5] << 40 | (ulong)buffer[offset1 + 6] << 48 | (ulong)buffer[offset1 + 7] << 56;
			ulong num2 = (ulong)buffer[offset2] | (ulong)buffer[offset2 + 1] << 8 | (ulong)buffer[offset2 + 2] << 16 | (ulong)buffer[offset2 + 3] << 24 | (ulong)buffer[offset2 + 4] << 32 | (ulong)buffer[offset2 + 5] << 40 | (ulong)buffer[offset2 + 6] << 48 | (ulong)buffer[offset2 + 7] << 56;
			return num ^ num2;
		}

		// Token: 0x0600019A RID: 410 RVA: 0x00006468 File Offset: 0x00004868
		private static bool Equal2(byte[] buffer, int offset1, int offset2)
		{
			return buffer[offset1] == buffer[offset2] && buffer[offset1 + 1] == buffer[offset2 + 1];
		}

		// Token: 0x0600019B RID: 411 RVA: 0x00006483 File Offset: 0x00004883
		private static bool Equal4(byte[] buffer, int offset1, int offset2)
		{
			return buffer[offset1] == buffer[offset2] && buffer[offset1 + 1] == buffer[offset2 + 1] && buffer[offset1 + 2] == buffer[offset2 + 2] && buffer[offset1 + 3] == buffer[offset2 + 3];
		}

		// Token: 0x0600019C RID: 412 RVA: 0x000064C0 File Offset: 0x000048C0
		private static void Copy4(byte[] buf, int src, int dst)
		{
			buf[dst + 3] = buf[src + 3];
			buf[dst + 2] = buf[src + 2];
			buf[dst + 1] = buf[src + 1];
			buf[dst] = buf[src];
		}

		// Token: 0x0600019D RID: 413 RVA: 0x000064E8 File Offset: 0x000048E8
		private static void Copy8(byte[] buf, int src, int dst)
		{
			buf[dst + 7] = buf[src + 7];
			buf[dst + 6] = buf[src + 6];
			buf[dst + 5] = buf[src + 5];
			buf[dst + 4] = buf[src + 4];
			buf[dst + 3] = buf[src + 3];
			buf[dst + 2] = buf[src + 2];
			buf[dst + 1] = buf[src + 1];
			buf[dst] = buf[src];
		}

		// Token: 0x0600019E RID: 414 RVA: 0x00006544 File Offset: 0x00004944
		private static void BlockCopy(byte[] src, int src_0, byte[] dst, int dst_0, int len)
		{
			if (len >= 16)
			{
				Buffer.BlockCopy(src, src_0, dst, dst_0, len);
			}
			else
			{
				while (len >= 8)
				{
					dst[dst_0] = src[src_0];
					dst[dst_0 + 1] = src[src_0 + 1];
					dst[dst_0 + 2] = src[src_0 + 2];
					dst[dst_0 + 3] = src[src_0 + 3];
					dst[dst_0 + 4] = src[src_0 + 4];
					dst[dst_0 + 5] = src[src_0 + 5];
					dst[dst_0 + 6] = src[src_0 + 6];
					dst[dst_0 + 7] = src[src_0 + 7];
					len -= 8;
					src_0 += 8;
					dst_0 += 8;
				}
				while (len >= 4)
				{
					dst[dst_0] = src[src_0];
					dst[dst_0 + 1] = src[src_0 + 1];
					dst[dst_0 + 2] = src[src_0 + 2];
					dst[dst_0 + 3] = src[src_0 + 3];
					len -= 4;
					src_0 += 4;
					dst_0 += 4;
				}
				while (len-- > 0)
				{
					dst[dst_0++] = src[src_0++];
				}
			}
		}

		// Token: 0x0600019F RID: 415 RVA: 0x00006638 File Offset: 0x00004A38
		private static int WildCopy(byte[] src, int src_0, byte[] dst, int dst_0, int dst_end)
		{
			int i = dst_end - dst_0;
			if (i >= 16)
			{
				Buffer.BlockCopy(src, src_0, dst, dst_0, i);
			}
			else
			{
				while (i >= 4)
				{
					dst[dst_0] = src[src_0];
					dst[dst_0 + 1] = src[src_0 + 1];
					dst[dst_0 + 2] = src[src_0 + 2];
					dst[dst_0 + 3] = src[src_0 + 3];
					i -= 4;
					src_0 += 4;
					dst_0 += 4;
				}
				while (i-- > 0)
				{
					dst[dst_0++] = src[src_0++];
				}
			}
			return i;
		}

		// Token: 0x060001A0 RID: 416 RVA: 0x000066C0 File Offset: 0x00004AC0
		private static int SecureCopy(byte[] buffer, int src, int dst, int dst_end)
		{
			int num = dst - src;
			int num2 = dst_end - dst;
			int i = num2;
			if (num >= 16)
			{
				if (num >= num2)
				{
					Buffer.BlockCopy(buffer, src, buffer, dst, num2);
					return num2;
				}
				do
				{
					Buffer.BlockCopy(buffer, src, buffer, dst, num);
					src += num;
					dst += num;
					i -= num;
				}
				while (i >= num);
			}
			while (i >= 4)
			{
				buffer[dst] = buffer[src];
				buffer[dst + 1] = buffer[src + 1];
				buffer[dst + 2] = buffer[src + 2];
				buffer[dst + 3] = buffer[src + 3];
				dst += 4;
				src += 4;
				i -= 4;
			}
			while (i-- > 0)
			{
				buffer[dst++] = buffer[src++];
			}
			return num2;
		}

		// Token: 0x060001A1 RID: 417 RVA: 0x00006770 File Offset: 0x00004B70
		public static int Encode32Safe(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			LZ4Codec.CheckArguments(input, inputOffset, inputLength, output, outputOffset, outputLength);
			if (outputLength == 0)
			{
				return 0;
			}
			if (inputLength < 65547)
			{
				ushort[] ushortHashTablePool = LZ4Codec.HashTablePool.GetUShortHashTablePool();
				return LZ4Codec.LZ4_compress64kCtx_safe32(ushortHashTablePool, input, output, inputOffset, outputOffset, inputLength, outputLength);
			}
			int[] intHashTablePool = LZ4Codec.HashTablePool.GetIntHashTablePool();
			return LZ4Codec.LZ4_compressCtx_safe32(intHashTablePool, input, output, inputOffset, outputOffset, inputLength, outputLength);
		}

		// Token: 0x060001A2 RID: 418 RVA: 0x000067C8 File Offset: 0x00004BC8
		public static int Encode64Safe(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			LZ4Codec.CheckArguments(input, inputOffset, inputLength, output, outputOffset, outputLength);
			if (outputLength == 0)
			{
				return 0;
			}
			if (inputLength < 65547)
			{
				ushort[] ushortHashTablePool = LZ4Codec.HashTablePool.GetUShortHashTablePool();
				return LZ4Codec.LZ4_compress64kCtx_safe64(ushortHashTablePool, input, output, inputOffset, outputOffset, inputLength, outputLength);
			}
			int[] intHashTablePool = LZ4Codec.HashTablePool.GetIntHashTablePool();
			return LZ4Codec.LZ4_compressCtx_safe64(intHashTablePool, input, output, inputOffset, outputOffset, inputLength, outputLength);
		}

		// Token: 0x060001A3 RID: 419 RVA: 0x00006820 File Offset: 0x00004C20
		public static int Decode32Safe(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			LZ4Codec.CheckArguments(input, inputOffset, inputLength, output, outputOffset, outputLength);
			if (outputLength == 0)
			{
				return 0;
			}
			int num = LZ4Codec.LZ4_uncompress_safe32(input, output, inputOffset, outputOffset, outputLength);
			if (num != inputLength)
			{
				throw new ArgumentException("LZ4 block is corrupted, or invalid length has been given.");
			}
			return outputLength;
		}

		// Token: 0x060001A4 RID: 420 RVA: 0x00006864 File Offset: 0x00004C64
		public static int Decode64Safe(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			LZ4Codec.CheckArguments(input, inputOffset, inputLength, output, outputOffset, outputLength);
			if (outputLength == 0)
			{
				return 0;
			}
			int num = LZ4Codec.LZ4_uncompress_safe64(input, output, inputOffset, outputOffset, outputLength);
			if (num != inputLength)
			{
				throw new ArgumentException("LZ4 block is corrupted, or invalid length has been given.");
			}
			return outputLength;
		}

		// Token: 0x060001A5 RID: 421 RVA: 0x000068A8 File Offset: 0x00004CA8
		private static int LZ4_compressCtx_safe32(int[] hash_table, byte[] src, byte[] dst, int src_0, int dst_0, int src_len, int dst_maxlen)
		{
			return 0;
		}

		// Token: 0x060001A6 RID: 422 RVA: 0x00006D30 File Offset: 0x00005130
		private static int LZ4_compress64kCtx_safe32(ushort[] hash_table, byte[] src, byte[] dst, int src_0, int dst_0, int src_len, int dst_maxlen)
		{
			return 0;
		}

		// Token: 0x060001A7 RID: 423 RVA: 0x00007184 File Offset: 0x00005584
		private static int LZ4_uncompress_safe32(byte[] src, byte[] dst, int src_0, int dst_0, int dst_len)
		{
			int[] decoder_TABLE_ = LZ4Codec.DECODER_TABLE_32;
			int num = src_0;
			int i = dst_0;
			int num2 = i + dst_len;
			int num3 = num2 - 5;
			int num4 = num2 - 8;
			int num5 = num2 - 8;
			int num6;
			int num8;
			for (;;)
			{
				byte b = src[num++];
				if ((num6 = b >> 4) == 15)
				{
					int num7;
					while ((num7 = (int)src[num++]) == 255)
					{
						num6 += 255;
					}
					num6 += num7;
				}
				num8 = i + num6;
				if (num8 > num4)
				{
					break;
				}
				if (i < num8)
				{
					int num9 = LZ4Codec.WildCopy(src, num, dst, i, num8);
					num += num9;
					i += num9;
				}
				num -= i - num8;
				i = num8;
				int num10 = num8 - (int)LZ4Codec.Peek2(src, num);
				num += 2;
				if (num10 < dst_0)
				{
					goto Block_6;
				}
				if ((num6 = (int)(b & 15)) == 15)
				{
					while (src[num] == 255)
					{
						num++;
						num6 += 255;
					}
					num6 += (int)src[num++];
				}
				if (i - num10 < 4)
				{
					dst[i] = dst[num10];
					dst[i + 1] = dst[num10 + 1];
					dst[i + 2] = dst[num10 + 2];
					dst[i + 3] = dst[num10 + 3];
					i += 4;
					num10 += 4;
					num10 -= decoder_TABLE_[i - num10];
					LZ4Codec.Copy4(dst, num10, i);
					i = i;
					num10 = num10;
				}
				else
				{
					LZ4Codec.Copy4(dst, num10, i);
					i += 4;
					num10 += 4;
				}
				num8 = i + num6;
				if (num8 > num5)
				{
					if (num8 > num3)
					{
						goto Block_11;
					}
					if (i < num4)
					{
						int num9 = LZ4Codec.SecureCopy(dst, num10, i, num4);
						num10 += num9;
						i += num9;
					}
					while (i < num8)
					{
						dst[i++] = dst[num10++];
					}
					i = num8;
				}
				else
				{
					if (i < num8)
					{
						LZ4Codec.SecureCopy(dst, num10, i, num8);
					}
					i = num8;
				}
			}
			if (num8 == num2)
			{
				LZ4Codec.BlockCopy(src, num, dst, i, num6);
				num += num6;
				return num - src_0;
			}
			Block_6:
			Block_11:
			return -(num - src_0);
		}

		// Token: 0x060001A8 RID: 424 RVA: 0x000073A4 File Offset: 0x000057A4
		private static int LZ4_compressCtx_safe64(int[] hash_table, byte[] src, byte[] dst, int src_0, int dst_0, int src_len, int dst_maxlen)
		{
			return 0;
		}

		// Token: 0x060001A9 RID: 425 RVA: 0x00007858 File Offset: 0x00005C58
		private static int LZ4_compress64kCtx_safe64(ushort[] hash_table, byte[] src, byte[] dst, int src_0, int dst_0, int src_len, int dst_maxlen)
		{
			return 0;
		}

		// Token: 0x060001AA RID: 426 RVA: 0x00007CD8 File Offset: 0x000060D8
		private static int LZ4_uncompress_safe64(byte[] src, byte[] dst, int src_0, int dst_0, int dst_len)
		{
			int[] decoder_TABLE_ = LZ4Codec.DECODER_TABLE_32;
			int[] decoder_TABLE_2 = LZ4Codec.DECODER_TABLE_64;
			int num = src_0;
			int i = dst_0;
			int num2 = i + dst_len;
			int num3 = num2 - 5;
			int num4 = num2 - 8;
			int num5 = num2 - 8 - 4;
			int num7;
			int num9;
			for (;;)
			{
				uint num6 = (uint)src[num++];
				if ((num7 = (int)((byte)(num6 >> 4))) == 15)
				{
					int num8;
					while ((num8 = (int)src[num++]) == 255)
					{
						num7 += 255;
					}
					num7 += num8;
				}
				num9 = i + num7;
				if (num9 > num4)
				{
					break;
				}
				if (i < num9)
				{
					int num10 = LZ4Codec.WildCopy(src, num, dst, i, num9);
					num += num10;
					i += num10;
				}
				num -= i - num9;
				i = num9;
				int num11 = num9 - (int)LZ4Codec.Peek2(src, num);
				num += 2;
				if (num11 < dst_0)
				{
					goto Block_6;
				}
				if ((num7 = (int)((byte)(num6 & 15U))) == 15)
				{
					while (src[num] == 255)
					{
						num++;
						num7 += 255;
					}
					num7 += (int)src[num++];
				}
				if (i - num11 < 8)
				{
					int num12 = decoder_TABLE_2[i - num11];
					dst[i] = dst[num11];
					dst[i + 1] = dst[num11 + 1];
					dst[i + 2] = dst[num11 + 2];
					dst[i + 3] = dst[num11 + 3];
					i += 4;
					num11 += 4;
					num11 -= decoder_TABLE_[i - num11];
					LZ4Codec.Copy4(dst, num11, i);
					i += 4;
					num11 -= num12;
				}
				else
				{
					LZ4Codec.Copy8(dst, num11, i);
					i += 8;
					num11 += 8;
				}
				num9 = i + num7 - 4;
				if (num9 > num5)
				{
					if (num9 > num3)
					{
						goto Block_11;
					}
					if (i < num4)
					{
						int num10 = LZ4Codec.SecureCopy(dst, num11, i, num4);
						num11 += num10;
						i += num10;
					}
					while (i < num9)
					{
						dst[i++] = dst[num11++];
					}
					i = num9;
				}
				else
				{
					if (i < num9)
					{
						LZ4Codec.SecureCopy(dst, num11, i, num9);
					}
					i = num9;
				}
			}
			if (num9 == num2)
			{
				LZ4Codec.BlockCopy(src, num, dst, i, num7);
				num += num7;
				return num - src_0;
			}
			Block_6:
			Block_11:
			return -(num - src_0);
		}

		// Token: 0x060001AB RID: 427 RVA: 0x00007F28 File Offset: 0x00006328
		public static int MaximumOutputLength(int inputLength)
		{
			return inputLength + inputLength / 255 + 16;
		}

		// Token: 0x060001AC RID: 428 RVA: 0x00007F38 File Offset: 0x00006338
		internal static void CheckArguments(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int outputLength)
		{
			if (inputLength == 0)
			{
				outputLength = 0;
				return;
			}
			if (input == null)
			{
				throw new ArgumentNullException("input");
			}
			if (inputOffset > input.Length)
			{
				throw new ArgumentOutOfRangeException("inputOffset");
			}
			if (inputLength > input.Length - inputOffset)
			{
				throw new ArgumentOutOfRangeException("inputLength");
			}
			if (output == null)
			{
				throw new ArgumentNullException("output");
			}
			if (outputOffset > output.Length)
			{
				throw new ArgumentOutOfRangeException("outputOffset");
			}
			if (outputLength > output.Length - outputOffset)
			{
				throw new ArgumentOutOfRangeException("outputLength");
			}
		}

		// Token: 0x04000058 RID: 88
		private const int MEMORY_USAGE = 12;

		// Token: 0x04000059 RID: 89
		private const int NOTCOMPRESSIBLE_DETECTIONLEVEL = 6;

		// Token: 0x0400005A RID: 90
		private const int MINMATCH = 4;

		// Token: 0x0400005B RID: 91
		private const int SKIPSTRENGTH = 6;

		// Token: 0x0400005C RID: 92
		private const int COPYLENGTH = 8;

		// Token: 0x0400005D RID: 93
		private const int LASTLITERALS = 5;

		// Token: 0x0400005E RID: 94
		private const int MFLIMIT = 12;

		// Token: 0x0400005F RID: 95
		private const int MINLENGTH = 13;

		// Token: 0x04000060 RID: 96
		private const int MAXD_LOG = 16;

		// Token: 0x04000061 RID: 97
		private const int MAXD = 65536;

		// Token: 0x04000062 RID: 98
		private const int MAXD_MASK = 65535;

		// Token: 0x04000063 RID: 99
		private const int MAX_DISTANCE = 65535;

		// Token: 0x04000064 RID: 100
		private const int ML_BITS = 4;

		// Token: 0x04000065 RID: 101
		private const int ML_MASK = 15;

		// Token: 0x04000066 RID: 102
		private const int RUN_BITS = 4;

		// Token: 0x04000067 RID: 103
		private const int RUN_MASK = 15;

		// Token: 0x04000068 RID: 104
		private const int STEPSIZE_64 = 8;

		// Token: 0x04000069 RID: 105
		private const int STEPSIZE_32 = 4;

		// Token: 0x0400006A RID: 106
		private const int LZ4_64KLIMIT = 65547;

		// Token: 0x0400006B RID: 107
		private const int HASH_LOG = 10;

		// Token: 0x0400006C RID: 108
		private const int HASH_TABLESIZE = 1024;

		// Token: 0x0400006D RID: 109
		private const int HASH_ADJUST = 22;

		// Token: 0x0400006E RID: 110
		private const int HASH64K_LOG = 11;

		// Token: 0x0400006F RID: 111
		private const int HASH64K_TABLESIZE = 2048;

		// Token: 0x04000070 RID: 112
		private const int HASH64K_ADJUST = 21;

		// Token: 0x04000071 RID: 113
		private const int HASHHC_LOG = 15;

		// Token: 0x04000072 RID: 114
		private const int HASHHC_TABLESIZE = 32768;

		// Token: 0x04000073 RID: 115
		private const int HASHHC_ADJUST = 17;

		// Token: 0x04000074 RID: 116
		private static readonly int[] DECODER_TABLE_32 = new int[]
		{
			0,
			3,
			2,
			3,
			0,
			0,
			0,
			0
		};

		// Token: 0x04000075 RID: 117
		private static readonly int[] DECODER_TABLE_64 = new int[]
		{
			0,
			0,
			0,
			-1,
			0,
			1,
			2,
			3
		};

		// Token: 0x04000076 RID: 118
		private static readonly int[] DEBRUIJN_TABLE_32 = new int[]
		{
			0,
			0,
			3,
			0,
			3,
			1,
			3,
			0,
			3,
			2,
			2,
			1,
			3,
			2,
			0,
			1,
			3,
			3,
			1,
			2,
			2,
			2,
			2,
			0,
			3,
			1,
			2,
			0,
			1,
			0,
			1,
			1
		};

		// Token: 0x04000077 RID: 119
		private static readonly int[] DEBRUIJN_TABLE_64 = new int[]
		{
			0,
			0,
			0,
			0,
			0,
			1,
			1,
			2,
			0,
			3,
			1,
			3,
			1,
			4,
			2,
			7,
			0,
			2,
			3,
			6,
			1,
			5,
			3,
			5,
			1,
			3,
			4,
			4,
			2,
			5,
			6,
			7,
			7,
			0,
			1,
			2,
			3,
			3,
			4,
			6,
			2,
			6,
			5,
			5,
			3,
			4,
			5,
			6,
			7,
			1,
			2,
			4,
			6,
			4,
			4,
			5,
			7,
			2,
			6,
			5,
			7,
			6,
			7,
			7
		};

		// Token: 0x04000078 RID: 120
		private const int MAX_NB_ATTEMPTS = 256;

		// Token: 0x04000079 RID: 121
		private const int OPTIMAL_ML = 18;

		// Token: 0x0400007A RID: 122
		private const int BLOCK_COPY_LIMIT = 16;

		// Token: 0x02000069 RID: 105
		internal static class HashTablePool
		{
			// Token: 0x060001AE RID: 430 RVA: 0x0000802F File Offset: 0x0000642F
			public static ushort[] GetUShortHashTablePool()
			{
				if (LZ4Codec.HashTablePool.ushortPool == null)
				{
					LZ4Codec.HashTablePool.ushortPool = new ushort[2048];
				}
				else
				{
					Array.Clear(LZ4Codec.HashTablePool.ushortPool, 0, LZ4Codec.HashTablePool.ushortPool.Length);
				}
				return LZ4Codec.HashTablePool.ushortPool;
			}

			// Token: 0x060001AF RID: 431 RVA: 0x00008066 File Offset: 0x00006466
			public static uint[] GetUIntHashTablePool()
			{
				if (LZ4Codec.HashTablePool.uintPool == null)
				{
					LZ4Codec.HashTablePool.uintPool = new uint[1024];
				}
				else
				{
					Array.Clear(LZ4Codec.HashTablePool.uintPool, 0, LZ4Codec.HashTablePool.uintPool.Length);
				}
				return LZ4Codec.HashTablePool.uintPool;
			}

			// Token: 0x060001B0 RID: 432 RVA: 0x0000809D File Offset: 0x0000649D
			public static int[] GetIntHashTablePool()
			{
				if (LZ4Codec.HashTablePool.intPool == null)
				{
					LZ4Codec.HashTablePool.intPool = new int[1024];
				}
				else
				{
					Array.Clear(LZ4Codec.HashTablePool.intPool, 0, LZ4Codec.HashTablePool.intPool.Length);
				}
				return LZ4Codec.HashTablePool.intPool;
			}

			// Token: 0x0400007B RID: 123
			[ThreadStatic]
			private static ushort[] ushortPool;

			// Token: 0x0400007C RID: 124
			[ThreadStatic]
			private static uint[] uintPool;

			// Token: 0x0400007D RID: 125
			[ThreadStatic]
			private static int[] intPool;
		}
	}
}
